package com.activity;

import com.type.ByteArrayParcelable;

import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TabHost;

public class RelateToMeTopicActivity extends TabActivity {
	TabHost tabHost;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.relate_to_me_topic_activity);
		
		String myPhNum = getIntent().getStringExtra(MainActivity.MY_PH_NUM);
		String myName = getIntent().getStringExtra(MainActivity.MY_NAME);
		ByteArrayParcelable myAvatar = (ByteArrayParcelable) getIntent().getParcelableExtra(MainActivity.MY_AVATAR);

		tabHost = getTabHost();

		TabHost.TabSpec tsMyCreatedTopic = tabHost.newTabSpec("my created topic tag");
		Intent ittMyCreatedTopic = new Intent(this, ViewMyCreatedTopicActivity.class);
		ittMyCreatedTopic.putExtra(MainActivity.MY_PH_NUM, myPhNum);
		ittMyCreatedTopic.putExtra(MainActivity.MY_NAME, myName);
		ittMyCreatedTopic.putExtra(MainActivity.MY_AVATAR, myAvatar);
		tsMyCreatedTopic.setContent(ittMyCreatedTopic);
		tsMyCreatedTopic.setIndicator("my created topic");
		tabHost.addTab(tsMyCreatedTopic);
		
		TabHost.TabSpec tsMySbcbedTopic = tabHost.newTabSpec("my subscribed topic tag");
		Intent ittMySbcbedTopic = new Intent(this, ViewMySbcbedTopicActivity.class);
		ittMySbcbedTopic.putExtra(MainActivity.MY_PH_NUM, myPhNum);
		ittMySbcbedTopic.putExtra(MainActivity.MY_NAME, myName);
		ittMySbcbedTopic.putExtra(MainActivity.MY_AVATAR, myAvatar);
		tsMySbcbedTopic.setContent(ittMySbcbedTopic);
		tsMySbcbedTopic.setIndicator("my subscribed topic");
		tabHost.addTab(tsMySbcbedTopic);
		
		TabHost.TabSpec tsMyCmtedTopic = tabHost.newTabSpec("my commented topic tag");
		Intent ittMyCmtedTopic = new Intent(this, ViewMyCmtedTopicActivity.class);
		ittMyCmtedTopic.putExtra(MainActivity.MY_PH_NUM, myPhNum);
		ittMyCmtedTopic.putExtra(MainActivity.MY_NAME, myName);
		ittMyCmtedTopic.putExtra(MainActivity.MY_AVATAR, myAvatar);
		tsMyCmtedTopic.setContent(ittMyCmtedTopic);
		tsMyCmtedTopic.setIndicator("my commented topic");
		tabHost.addTab(tsMyCmtedTopic);
	}
}
